Documentation for pyppl_report

A relative path template

A relative path template

A relative path template

A relative path template

A relative path template

Title

Download filetable

Image

TOC

Table of contents will be automatically generated by scanning the document for headings.

If you want some headings to be excluded from TOC, you just do:

## Exluded {toc=false}
      xyb

Following heading will be excluded:

TOC-excluded

This is a very very very very very very very very very long heading

This is a third-level heading

Admonitions

This is a note

:::{.admon .note head=Hello}
      This is a note
      :::

This is a warning class: .warn/.warning

This is an info class: .info

This is an error

:::{.admon .error}
      This is an error
      :::

This is an example class: .example

No head

head=false

Tables

Tables with all data

You can insert links into the table by using <ALT: HREF>.

Numbers are rounded to 3 decimals if length > 10.

Tables with subset of data and download available

Tables without data file

```table
      caption: Data table
      download: true
      csvargs:
        delimiter: ","
      ---
      ID,Name,Sex,Age
      1,Bob,M,49
      2,Alice,F,20
      ```

References/Links

  • Something needs ref [1]
    - Something needs ref [l]
      
          ... ...
      
          [l]: ref1
[A link with attributes](somelink "title"){a=1 b=2 c="xy" d=False f="m, n"}
[A downloadable link](./downloadfile.txt){download=true}

If links are relative path to local files, they should be relative to the markdown file.

Images

Images are lazy-loaded.

Add a single image

<!-- empty line -->
      ![Snapshot](./snapshot.png){attributes ...}
      <!-- empty line -->
Snapshot

Add images as a combined figure

<!-- no empty lines among the images -->
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)

Snapshot Snapshot Snapshot

Relative image path should be relative to the markdown file.

When pyppl_report work as a PyPPL plugin, we usually pass the absolute path. However, when it works as a CLI tool, relative path may be used.

Panels

A set of panels are blocks that only occupy one panel space in the page by using tabs or accordions, based on the number of this set of panels.

Auto-decide to use tabs or accordions

When number of panels <= 4 we will use tabs, otherwise accordions are used.

::: {.panel head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

panel1

panel2

Accordions

panel1

panel2

panel1

panel2

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel1

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel2

Force tabs or accordions

::: {.panel .tab head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::
::: {.panel .accordion head=Panel1}
      The quick brown fox jumps over the lazy dog.
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

TOC

Table of contents will be automatically generated by scanning the document for headings.

If you want some headings to be excluded from TOC, you just do:

## Exluded {toc=false}
      xyb

Following heading will be excluded:

TOC-excluded

This is a very very very very very very very very very long heading

This is a third-level heading

Admonitions

This is a note

:::{.admon .note head=Hello}
      This is a note
      :::

This is a warning class: .warn/.warning

This is an info class: .info

This is an error

:::{.admon .error}
      This is an error
      :::

This is an example class: .example

No head

head=false

Tables

Tables with all data

You can insert links into the table by using <ALT: HREF>.

Numbers are rounded to 3 decimals if length > 10.

Tables with subset of data and download available

Tables without data file

```table
      caption: Data table
      download: true
      csvargs:
        delimiter: ","
      ---
      ID,Name,Sex,Age
      1,Bob,M,49
      2,Alice,F,20
      ```

References/Links

  • Something needs ref [1]
    - Something needs ref [l]
      
          ... ...
      
          [l]: ref1
[A link with attributes](somelink "title"){a=1 b=2 c="xy" d=False f="m, n"}
[A downloadable link](./downloadfile.txt){download=true}

If links are relative path to local files, they should be relative to the markdown file.

Images

Images are lazy-loaded.

Add a single image

<!-- empty line -->
      ![Snapshot](./snapshot.png){attributes ...}
      <!-- empty line -->
Snapshot

Add images as a combined figure

<!-- no empty lines among the images -->
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)

Snapshot Snapshot Snapshot

Relative image path should be relative to the markdown file.

When pyppl_report work as a PyPPL plugin, we usually pass the absolute path. However, when it works as a CLI tool, relative path may be used.

Panels

A set of panels are blocks that only occupy one panel space in the page by using tabs or accordions, based on the number of this set of panels.

Auto-decide to use tabs or accordions

When number of panels <= 4 we will use tabs, otherwise accordions are used.

::: {.panel head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

panel1

panel2

Accordions

panel1

panel2

panel1

panel2

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel1

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel2

Force tabs or accordions

::: {.panel .tab head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::
::: {.panel .accordion head=Panel1}
      The quick brown fox jumps over the lazy dog.
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

TOC

Table of contents will be automatically generated by scanning the document for headings.

If you want some headings to be excluded from TOC, you just do:

## Exluded {toc=false}
      xyb

Following heading will be excluded:

TOC-excluded

This is a very very very very very very very very very long heading

This is a third-level heading

Admonitions

This is a note

:::{.admon .note head=Hello}
      This is a note
      :::

This is a warning class: .warn/.warning

This is an info class: .info

This is an error

:::{.admon .error}
      This is an error
      :::

This is an example class: .example

No head

head=false

Tables

Tables with all data

You can insert links into the table by using <ALT: HREF>.

Numbers are rounded to 3 decimals if length > 10.

Tables with subset of data and download available

Tables without data file

```table
      caption: Data table
      download: true
      csvargs:
        delimiter: ","
      ---
      ID,Name,Sex,Age
      1,Bob,M,49
      2,Alice,F,20
      ```

References/Links

  • Something needs ref [1]
    - Something needs ref [l]
      
          ... ...
      
          [l]: ref1
[A link with attributes](somelink "title"){a=1 b=2 c="xy" d=False f="m, n"}
[A downloadable link](./downloadfile.txt){download=true}

If links are relative path to local files, they should be relative to the markdown file.

Images

Images are lazy-loaded.

Add a single image

<!-- empty line -->
      ![Snapshot](./snapshot.png){attributes ...}
      <!-- empty line -->
Snapshot

Add images as a combined figure

<!-- no empty lines among the images -->
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)
      ![Snapshot](./snapshot.png)

Snapshot Snapshot Snapshot

Relative image path should be relative to the markdown file.

When pyppl_report work as a PyPPL plugin, we usually pass the absolute path. However, when it works as a CLI tool, relative path may be used.

Panels

A set of panels are blocks that only occupy one panel space in the page by using tabs or accordions, based on the number of this set of panels.

Auto-decide to use tabs or accordions

When number of panels <= 4 we will use tabs, otherwise accordions are used.

::: {.panel head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

panel1

panel2

Accordions

panel1

panel2

panel1

panel2

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel1

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

The quick brown fox jumps over the lazy dog.

panel2

Force tabs or accordions

::: {.panel .tab head=Panel1}
      panel1
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::
::: {.panel .accordion head=Panel1}
      The quick brown fox jumps over the lazy dog.
      :::
      
      ::: {.panel head=Panel2}
      panel2
      :::

pyppl_report

[[Pypi][[2]](#PYPPL-REF-2){.pyppl-report-refindex}][[3]](#PYPPL-REF-3){.pyppl-report-refindex} [[Github][[4]](#PYPPL-REF-4){.pyppl-report-refindex}][[5]](#PYPPL-REF-5){.pyppl-report-refindex} [[PyPPL][[6]](#PYPPL-REF-6){.pyppl-report-refindex}][[7]](#PYPPL-REF-7){.pyppl-report-refindex} [[PythonVers][[8]](#PYPPL-REF-8){.pyppl-report-refindex}][[3]](#PYPPL-REF-3){.pyppl-report-refindex} [[docs][[9]](#PYPPL-REF-9){.pyppl-report-refindex}][[10]](#PYPPL-REF-10){.pyppl-report-refindex} [[Travis building][[11]](#PYPPL-REF-11){.pyppl-report-refindex}][[12]](#PYPPL-REF-12){.pyppl-report-refindex} [[Codacy][[13]](#PYPPL-REF-13){.pyppl-report-refindex}][[14]](#PYPPL-REF-14){.pyppl-report-refindex} [[Codacy coverage][[15]](#PYPPL-REF-15){.pyppl-report-refindex}][[14]](#PYPPL-REF-14){.pyppl-report-refindex}

A report generating system for [PyPPL][[7]](#PYPPL-REF-7){.pyppl-report-refindex}

Installation

Requires pandoc 2.7+ (and wkhtmltopdf 0.12.4+ when creating PDF reports)

pyppl_report requires pandoc/wkhtmltopdf to be installed in $PATH

pip install pyppl_report

Usage

Specifiation of template

pPyClone.config.report_template = """
      # {{report.title}}
      
      PyClone[[7]](#PYPPL-REF-7){.pyppl-report-refindex} is a tool using Probabilistic model for inferring clonal population
      structure from deep NGS sequencing.
      
      ![Similarity matrix]({{path.join(job.o.outdir, "plots/loci/similarity_matrix.svg")}})
      
      ```table
      caption: Clusters
      file: "{{path.join(job.o.outdir, "tables/cluster.tsv")}}"
      rows: 10
      ```
      
      Nature methods 11.4 (2014): 396.
      """
      
      # or use a template file
      
      pPyClone.config.report_template = "file:/path/to/template.md"

Generating report

PyPPL().start(pPyClone).run().report(
          '/path/to/report',
          title='Clonality analysis using PyClone',
          template='bootstrap'
      )
      
      # or save report in a directory
      PyPPL(name='Awesome-pipeline').start(pPyClone).run().report('/path/to/')
      # report generated at ./Awesome-pipeline.report.html

Extra data for rendering

You can generate a toml file named job.report.data.toml under <job.outdir> with extra data to render the report template. Beyond that, proc attributes and args can also be used.

For example: job.report.data.toml:

description = 'A awesome report for job 1'

Then in your template, you can use it:

## {{jobs[0].description}}

References

We use [[7]](#PYPPL-REF-7){.pyppl-report-refindex}, [[10]](#PYPPL-REF-10){.pyppl-report-refindex} … to link to the references, so HTML links have to be in-place (in the format of [text](link) instead of [text][link-index]). All references from different processes will be re-ordered and combined.

Built-in themes

Bootstrip Layui Semantic

Reference

[1]: ref1[2]: https://img.shields.io/pypi/v/pyppl_report?style=flat-square[3]: https://pypi.org/project/pyppl_report/[4]: https://img.shields.io/github/tag/pwwang/pyppl_report?style=flat-square[5]: https://github.com/pwwang/pyppl_report[6]: https://img.shields.io/github/tag/pwwang/pyppl?label=PyPPL&style=flat-square[7]: https://github.com/pwwang/PyPPL[8]: https://img.shields.io/pypi/pyversions/pyppl_report?style=flat-square[9]: https://img.shields.io/readthedocs/pyppl_report.svg?style=flat-square[10]: https://pyppl_report.readthedocs.io/en/latest/[11]: https://img.shields.io/travis/pwwang/pyppl_report?style=flat-square[12]: https://travis-ci.org/pwwang/pyppl_report[13]: https://img.shields.io/codacy/grade/2b7914a18f794248a62d7b36eb2408a3?style=flat-square[14]: https://app.codacy.com/manual/pwwang/pyppl_report/dashboard[15]: https://img.shields.io/codacy/coverage/2b7914a18f794248a62d7b36eb2408a3?style=flat-square